package com.linkhub.oms.data.sync.api.track.client;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.http.ForestResponse;
import com.linkhub.oms.data.sync.api.track.domain.request.TrackBaseRequest;
import com.linkhub.oms.data.sync.api.track.domain.response.TrackAcceptedBase;
import com.linkhub.oms.data.sync.api.track.domain.response.TrackBaseResponse;
import com.linkhub.oms.data.sync.api.track.domain.response.TrackRegisterAcceptedData;

import java.util.List;

@BaseRequest(
        baseURL = "#{track.apiUrl}",
        headers = {
                "17token: #{track.key}",
                "Content-Type:application/json"
        }
)
public interface TrackClient {

    /**
     * 注册物流单号
     * @param request
     * @return
     */
    @Post("/register")
    ForestResponse<TrackBaseResponse<TrackRegisterAcceptedData>> register(@JSONBody List<TrackBaseRequest> request);

    /**
     * 停止跟踪
     * @param request
     * @return
     */
    @Post("/stoptrack")
    ForestResponse<TrackBaseResponse<TrackAcceptedBase>> stopTrack(@JSONBody List<TrackBaseRequest> request);

    /**
     * 重启跟踪
     * @param request
     * @return
     */
    @Post("/retrack")
    ForestResponse<TrackBaseResponse<TrackAcceptedBase>> reTrack(@JSONBody List<TrackBaseRequest> request);

    /**
     * 删除物流单号
     * @param request
     * @return
     */
    @Post("/deletetrack")
    ForestResponse<TrackBaseResponse<TrackAcceptedBase>> deleteTrack(@JSONBody List<TrackBaseRequest> request);

    /**
     * 手动推送
     * @param request
     * @return
     */
    @Post("/push")
    ForestResponse<TrackBaseResponse<TrackAcceptedBase>> push(@JSONBody List<TrackBaseRequest> request);

}
